Flash memory is a non-volatile memory that is capable of retaining data stored therein even when not powered. Since flash memory has the advantages of having low volume, low power consumption, good shock resistance and fast writing speed, flash memory is widely applied to various types of electronic products such as memory cards, portable disks, digital cameras, portable electronic game consoles, minicomputers, and the like.
Flash memories apply floating-gate transistors for storing data, and are divided into two types—NOR flash and NAND flash according to an access mode of the flash memory; NOR flash memory is used for storing program code, and NAND flash memory is used for storing digital data. NAND flash memories are also divided into two structures according to the number of data stored in each of the transistors—a single-level cell (SLC) structure and a multi-level cell (MLC) structure.
NAND flash memory with the SLC structure has advantages of having a faster speed and lower power consumption, and each of the storage units in such NAND flash memory can store one information bit. Although a NAND flash memory with the MLC structure has a slower transmission speed and higher power consumption, each of the storage units in such NAND flash can store more than two information bits, thereby reducing production cost.
NOR flash memory comprises an address pin, a data pin and a control pin, which are independent from one another. In contrast, NAND flash memory transmits addresses, digital data and commands via a single input/output pin, and identifies types of current transmission information at the input/output pin via different control signals.
With respect to NAND flash memory, in a write procedure, an external control chip or a microprocessor transmits target addresses and digital data in sequence to the NAND flash memory via the input/output pin. The digital data is first temporarily stored in buffers in the NAND flash memory, and is then shifted from the buffers to storage units corresponding to the target addresses in a write period after the control chip or the microprocessor gives a write command.
When power supply of the NAND flash memory is interrupted before the write period ends, digital data being written into certain storage units may be destroyed. Since data being stored into the NAND flash memory may be program code currently being executed or calculated or other important data, when errors of the data occur, an electronic product containing the NAND flash memory may crash or incur critical errors.
In addition, many conventional flash memories comprise write protection pins. When a write protection pin of a conventional flash memory is programmed to a write protection status, the flash conventional memory rejects commands of writing data from any external systems. In theory, the conventional flash memory begins performing a write procedure only when the write protection pin is programmed to allow write operations.
However, in the foregoing write period, when a user or an external system accidentally switches the write protection pin of the conventional flash memory to enable write protection, the write procedure in process is interrupted. Accordingly, digital data currently being written into certain storage units may be destroyed and thereby detrimentally influence normal operations of an electronic product containing the conventional flash memory.
Compared to NAND flash memory with the SLC structure, when power supply is cut off or the write protection pin is changed during the write procedure, the consequences caused in the NAND flash memory with the MLC structure becomes more severe since not only is the digital data in the process of being written into the storage units destroyed, but other digital data originally stored in the same storage units may also be ruined.
Solutions for solving the foregoing problem of data destruction of a flash memory are not yet available in the prior art.